package com.tp2.dao;

import java.util.ArrayList;
import java.util.Collection;
import org.xml.sax.Attributes;
import org.xml.sax.SAXException;
import com.tp2.dominio.MedioDePago;

public class ParserMediosDePago extends Parser {
	

	private Collection<MedioDePago> mediosDePago;
	
	
	public ParserMediosDePago(){
		
		super("src/main/resources/mediosDePagoXML.xml");
		mediosDePago = new ArrayList<MedioDePago>();
		parseDocument();
	}
	
	public ParserMediosDePago(String nombreXML){
		
		super("src/main/resources/"+nombreXML);
		mediosDePago = new ArrayList<MedioDePago>();
		parseDocument();
	}
	
	public Collection<MedioDePago> getMediosDePago() {
		return mediosDePago;
	}

	@Override
	public void startElement(String s, String s1, String elementName, Attributes attributes)
			throws SAXException {

	
	}

	@Override
	public void endElement(String s, String s1, String element) throws SAXException {

		if (element.equalsIgnoreCase("MedioDePago")) {

			mediosDePago.add(new MedioDePago(tmpValue));

		}

	}

}
